package com.dlyk.mapper;

import com.dlyk.commons.DataScope;
import com.dlyk.model.Activity;
import com.dlyk.query.ActivityQuery;
import com.dlyk.query.BaseQuery;
import com.dlyk.result.ChartData;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;

public interface ActivityMapper {
    int deleteByPrimaryKey(Integer id);

    int insert(Activity record);

    int insertSelective(Activity record);

    Activity selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Activity record);

    int updateByPrimaryKey(Activity record);

    // 查询市场活动列表信息的时候，需要判断用户权限
    // 表的别名：a，根据负责人字段进行过滤，普通用户只能查询自己负责的市场活动
    @DataScope(tableAlias = "a", tableField = "owner_id")
    List<Activity> selectActivityListByPage(ActivityQuery activityQuery);

    Activity selectActivityDetailById(Integer id);

    int deleteByIds(List<String> ids);

    List<Activity> selectAllOngoingActivity();

    int selectActivityTotalCount();

    List<ChartData> selectActivityCountByMonth();
}

